package com.symbio.ishenapi.background.controller;

import com.symbio.ishenapi.background.model.TmNotifications;
import com.symbio.ishenapi.common.controller.BaseController;
import io.jboot.web.controller.annotation.RequestMapping;

import java.util.Date;

@RequestMapping("/TmNotificationsController")
public class TmNotificationsController extends BaseController {

    /**
     * @author  jun
     *发送消息保存
     */
    public void saveTmNotifications(){
        TmNotifications user = (TmNotifications)getReqBodyObject(TmNotifications.class);
        user.setCreateTime(new Date());
        if (user.getContent() == null || "".equals(user.getContent())) {
            renderJsonError(40003, "内容");
        }else if (user.getPort() == null || "".equals(user.getPort())){
            renderJsonError(40003, "发送人");
        }
        else {
            user.save();
            renderJsonRet(40001);
        }
    }

}
